package itheima.edu.info.Exdents.Fanxing;

import itheima.edu.info.manager.domain.Student;

import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;

public class TreeSetTest {
    public static void main(String[] args) {
        Mnay ad=new Mnay("zhangsan",23);
        Mnay ad1=new Mnay("lizhihong",23);
        Mnay ad2=new Mnay("wuxuanyi",24);
        TreeSet<Mnay> mnays=new TreeSet<>(/*new Comparator<Mnay>() {
            @Override
            public int compare(Mnay o1, Mnay o2) {
                int i = o1.getAge() - o2.getAge();
                int i1 = i == 0 ? o1.getName().compareTo(o2.getName()):i;
                return i1;
            }
        }*/);
        mnays.add(ad);
        mnays.add(ad1);
        mnays.add(ad2);
        System.out.println(mnays);


    }
}
